From 00cac7da1ccaeb07bc0d94c5c6453f55b6259d4b Mon Sep 17 00:00:00 2001 From: "emellor@ewan" Date: Sun, 18 Sep 2005 10:09:22 +0100 Subject: [PATCH] In all cases, move the creation of a new transaction outside of the block handling exceptions raised inside that transaction. If the creation (start) of the transaction fails, then t has not been assigned, and in any case no transaction has been created, so it is wrong to attempt to abort that (non-existent) transaction. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/xenstore/xstransact.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/python/xen/xend/xenstore/xstransact.py b/tools/python/xen/xend/xenstore/xstransact.py index 3c56251659..d76dd88a90 100644 --- a/tools/python/xen/xend/xenstore/xstransact.py +++ b/tools/python/xen/xend/xenstore/xstransact.py @@ -151,8 +151,8 @@ class xstransact: def Read(cls, path, *args): while True: + t = cls(path) try: - t = cls(path) v = t.read(*args) t.commit() return v @@ -170,8 +170,8 @@ class xstransact: def Write(cls, path, *args, **opts): while True: + t = cls(path) try: - t = cls(path) t.write(*args, **opts) t.commit() return @@ -189,8 +189,8 @@ class xstransact: def Remove(cls, path, *args): while True: + t = cls(path) try: - t = cls(path) t.remove(*args) t.commit() return @@ -208,8 +208,8 @@ class xstransact: def List(cls, path, *args): while True: + t = cls(path) try: - t = cls(path) v = t.list(*args) t.commit() return v @@ -227,8 +227,8 @@ class xstransact: def Gather(cls, path, *args): while True: + t = cls(path) try: - t = cls(path) v = t.gather(*args) t.commit() return v @@ -246,8 +246,8 @@ class xstransact: def Store(cls, path, *args): while True: + t = cls(path) try: - t = cls(path) v = t.store(*args) t.commit() return v -- 2.30.2